<template>
  <main-layout>
    <!-- 联系表单部分 -->
    <section class="py-20">
      <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
          <!-- 左侧联系信息 -->
          <div v-motion-slide-visible-once-left class="space-y-6">
            <h2 class="text-3xl font-bold text-red-500 text-center">
              {{ $tm('contact.letsTalk') }}
            </h2>
            
            <!-- 联系方式列表 -->
            <div class="space-y-6 px-10 py-10">
              <!-- 电话联系方式 -->
              <div class="flex items-start space-x-4 p-3 rounded-lg">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-8 text-red-500" viewBox="0 0 24 24" fill="none" stroke="currentColor">
                  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" />
                </svg>
                <div class="flex items-center">
                  <p class="text-gray-900 font-medium">{{ $tm('contact.phone') }}</p>
                </div>
              </div>

              <!-- 邮箱联系方式 -->
              <div class="flex items-start space-x-4 p-3 rounded-lg">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-8 text-red-500" viewBox="0 0 24 24" fill="none" stroke="currentColor">
                  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
                </svg>
                <div class="flex items-center">
                  <p class="text-gray-900 font-medium">{{ $tm('contact.email') }}</p>
                </div>
              </div>

              <!-- 地址联系方式 -->
              <div class="flex items-start space-x-4 p-3 rounded-lg">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-8 text-red-500" viewBox="0 0 24 24" fill="none" stroke="currentColor">
                  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
                </svg>
                <div class="flex items-center">
                  <p class="text-gray-900 font-medium">{{ $tm('contact.address') }}</p>
                </div>
              </div>
            </div>
          </div>

          <!-- 右侧表单 -->
          <div v-motion-slide-visible-once-right class="bg-white p-8 rounded-2xl shadow-lg transform hover:scale-[1.02] transition-all duration-300">
            <h3 class="text-2xl font-bold mb-8 text-gray-800 relative after:content-[''] after:absolute after:bottom-[-8px] after:left-0 after:w-20 after:h-1 after:bg-red-500">
              {{ $tm('contact.submitRequest') }}
            </h3>
            
            <form class="space-y-6">
              <!-- 姓名输入框组 -->
              <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                <div class="group">
                  <input 
                    type="text" 
                    class="peer w-full px-4 py-3 border-b-2 border-gray-200 focus:border-red-500 outline-none transition-all bg-transparent"
                    :placeholder="$tm('contact.firstName')"
                  >
                  <div class="h-0.5 w-0 group-hover:w-full transition-all duration-300 bg-red-500"></div>
                </div>
                <div class="group">
                  <input 
                    type="text"
                    class="peer w-full px-4 py-3 border-b-2 border-gray-200 focus:border-red-500 outline-none transition-all bg-transparent"
                    :placeholder="$tm('contact.lastName')"
                  >
                  <div class="h-0.5 w-0 group-hover:w-full transition-all duration-300 bg-red-500"></div>
                </div>
              </div>

              <div class="group">
                <input 
                  type="email"
                  class="peer w-full px-4 py-3 border-b-2 border-gray-200 focus:border-red-500 outline-none transition-all bg-transparent"
                  :placeholder="$tm('contact.email')"
                >
                <div class="h-0.5 w-0 group-hover:w-full transition-all duration-300 bg-red-500"></div>
              </div>

              <div class="group">
                <input 
                  type="tel"
                  class="peer w-full px-4 py-3 border-b-2 border-gray-200 focus:border-red-500 outline-none transition-all bg-transparent"
                  :placeholder="$tm('contact.phone')"
                >
                <div class="h-0.5 w-0 group-hover:w-full transition-all duration-300 bg-red-500"></div>
              </div>

              <div class="group">
                <select 
                  class="peer w-full px-4 py-3 border-b-2 border-gray-200 focus:border-red-500 outline-none transition-all bg-transparent"
                >
                  <option value="" disabled selected>{{ $tm('contact.requestType') }}</option>
                </select>
                <div class="h-0.5 w-0 group-hover:w-full transition-all duration-300 bg-red-500"></div>
              </div>

              <div class="group">
                <textarea
                  class="peer w-full px-4 py-3 border-b-2 border-gray-200 focus:border-red-500 outline-none transition-all bg-transparent"
                  :placeholder="$tm('contact.message')"
                  rows="4"
                ></textarea>
                <div class="h-0.5 w-0 peer-hover:w-full transition-all duration-300 bg-red-500"></div>
              </div>

              <!-- 文件上传区域 -->
              <div class="group border-2 border-dashed border-gray-200 rounded-xl p-6 text-center cursor-pointer hover:border-red-500 hover:bg-red-50/30 transition-all duration-300">
                <div class="relative">
                  <svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 mx-auto mb-4 text-red-500 transform group-hover:scale-110 transition-transform duration-300" viewBox="0 0 24 24" fill="none" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" />
                  </svg>
                  <p class="text-sm font-medium text-gray-700">{{ $tm('contact.dragAndDrop') }}</p>
                  <p class="text-xs text-gray-500 mt-2">{{ $tm('contact.browseFiles') }}</p>
                </div>
              </div>

              <!-- 提交按钮 -->
              <button
                type="submit"
                class="w-full bg-gradient-to-r from-red-500 to-red-600 text-white py-3 px-6 rounded-xl font-medium
                       hover:from-red-600 hover:to-red-700 transform hover:-translate-y-0.5 
                       transition-all duration-300 shadow-lg hover:shadow-red-500/30"
              >
                {{ $tm('contact.submit') }}
              </button>
            </form>
          </div>
        </div>
      </div>
    </section>

    <!-- 在线报价引擎部分 -->
    <section class="py-20 bg-gray-50">
      <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <div class="grid grid-cols-1 md:grid-cols-2 gap-8 items-center">
          <div v-motion-slide-visible-once-left class="space-y-4">
            <h2 class="text-2xl font-bold">{{ $tm('contact.quoteEngine.title') }}</h2>
            <p class="text-gray-600">{{ $tm('contact.quoteEngine.description') }}</p>
            <div class="flex items-center space-x-2">
              <router-link 
                to="/order" 
                class="inline-flex items-center px-6 py-2 bg-red-500 text-white rounded-md hover:bg-red-600 transition-colors"
              >
                {{ $tm('contact.quoteEngine.button') }}
                <i class="fas fa-arrow-right ml-2"></i>
              </router-link>
            </div>
          </div>
          <div v-motion-slide-visible-once-right>
            <img 
              src="/images/factory/factory.png" 
              alt="Quote Engine"
              class="w-full rounded-lg shadow-lg"
            >
          </div>
        </div>
      </div>
    </section>

    <!-- 尝试使用部分 -->
    <section class="py-20">
      <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
          <div v-for="(item, index) in $tm('contact.tryIt.items')" :key="index"
               v-motion-slide-visible-once-bottom
               class="bg-white p-6 rounded-lg shadow-lg hover:shadow-xl transition-shadow">
            <img :src="item.image" :alt="item.title" class="w-full h-48 object-cover rounded-lg mb-4">
            <h3 class="text-xl font-semibold mb-2">{{ item.title }}</h3>
            <p class="text-gray-600 mb-4">{{ item.description }}</p>
            <a href="#" class="text-red-500 hover:text-red-600 transition-colors flex items-center space-x-2">
              <span>{{ $tm('contact.tryIt.learnMore') }}</span>
              <i class="fas fa-arrow-right"></i>
            </a>
          </div>
        </div>
      </div>
    </section>
  </main-layout>
</template>

<script setup lang="ts">
import MainLayout from '../layouts/MainLayout.vue'
</script> 